import * as TYPES from '../action/types'

export function userInfo_reducer(state = initState, action) {
  switch (action.type) {
    case TYPES.USER_ACCOUNT:
      return {
        ...state,
        user_account: action.data
      }
      break
    case TYPES.USER_PASSWORD:
      return {
        ...state,
        user_password: action.data
      }

    case TYPES.USER_PASSWORD_REMEMBER:
      return {
        ...state,
        user_passwordRemember: action.data
      }

    case TYPES.USER_LOGIN_userInfo:
      return {
        ...state,
        user_info: action.data
      }

    default:
      return state
  }
}

const initState = {
  user_account: APP_DEBUG ? '9999' : null,
  user_password: APP_DEBUG ? '123456' : null,
  user_passwordRemember: null,
  user_info: {}
}
